package com.c2soft.nepalcmx.services;

import java.text.ParseException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.c2soft.nepalcmx.command.AccountDetailCommand;

import com.c2soft.nepalcmx.command.ConfirmTradeCommand;
import com.c2soft.nepalcmx.command.TradeBookCommand;
import com.c2soft.nepalcmx.dao.AccountDetailDAO;

@Service
public class AccountDetailService {
	
	@Autowired
	private AccountDetailDAO accountDetailDAO;

	public boolean accountService(AccountDetailCommand account) {
		boolean i=accountDetailDAO.saveAccountDetailService(account);
		return i;
	}
	
	public boolean brokerAccountService(AccountDetailCommand account) {
		boolean i=accountDetailDAO.saveBrokerAccountDetailService(account);
		return i;
	}
	
	public void exchangeAccountService(AccountDetailCommand account) {
		accountDetailDAO.saveAccountDetailServiceX(account);
		
	}
	
	
public List<AccountDetailCommand> getAccountDetail(String brokerId) {
		
	return accountDetailDAO.findUserAccDetails(brokerId);
	}

public List<AccountDetailCommand> getUserAccounts(String userId) {
	
	return accountDetailDAO.findUserAccountDetails(userId);
}

public List<AccountDetailCommand> getAccounts(String userId) {
	
	return accountDetailDAO.findAccountDetails(userId);
}
public List<AccountDetailCommand> getAccounts1(String userId,String brokerId) {
	
	return accountDetailDAO.findAccountDetails1(userId,brokerId);
}

public List<AccountDetailCommand> getUserAccountsDetail(String userId) {
	
	return accountDetailDAO.findUserAccount(userId);
}

public List<AccountDetailCommand> getUserAccount(String userId) {
	
	return accountDetailDAO.getUserAccount(userId);
}




public void updateAccountService(AccountDetailCommand account) {
	accountDetailDAO.updateAccountDetailService(account);
}

public List<AccountDetailCommand> getAccountEntries(String userId,ConfirmTradeCommand accountDetail) throws ParseException {
	
	
	return accountDetailDAO.findAllAccountDetails(userId,accountDetail);
}

public List<AccountDetailCommand> getBillsEntries(String userId,ConfirmTradeCommand accountDetail) throws ParseException {
	
	
	return accountDetailDAO.findAllBillDetails(userId,accountDetail);
}

}
